local gamelib = require "club.threecard.gamelib"

local rank_item = gamelib.ui.element()

function rank_item:on_scroll_cell_update(data, index)
    local player_id = data.player_id;
    local t = 
    {
        [1] = "st";
        [2] = "nd";
        [3] = "rd";
    }
    self.rank_txt.text = index .. (t[index] or "th");
    self.name_txt.text = "玩家："..player_id;
    self.value_txt.text = string.format("$%s", data.bets);
end

return rank_item